<?php

/**
 * Empleado form base class.
 *
 * @method Empleado getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseEmpleadoForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'emp_id'       => new sfWidgetFormInputHidden(),
      'emp_nombre'   => new sfWidgetFormInputText(),
      'emp_apellido' => new sfWidgetFormInputText(),
      'emp_login'    => new sfWidgetFormInputText(),
      'emp_pass'     => new sfWidgetFormInputText(),
      'emp_perfil'   => new sfWidgetFormInputText(),
      'emp_ruta'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'emp_id'       => new sfValidatorChoice(array('choices' => array($this->getObject()->getEmpId()), 'empty_value' => $this->getObject()->getEmpId(), 'required' => false)),
      'emp_nombre'   => new sfValidatorString(array('max_length' => 50)),
      'emp_apellido' => new sfValidatorString(array('max_length' => 50)),
      'emp_login'    => new sfValidatorString(array('max_length' => 50)),
      'emp_pass'     => new sfValidatorString(array('max_length' => 50)),
      'emp_perfil'   => new sfValidatorString(array('max_length' => 50)),
      'emp_ruta'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Empleado', 'column' => array('emp_login')))
    );

    $this->widgetSchema->setNameFormat('empleado[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Empleado';
  }


}
